﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;
using ThirdServices.AlertModel.Factory.Entities.DTO;
using ThirdServices.EarthquakeSettings;

namespace ThirdServices.AlertModel.Analyzers
{
    class EarthquakeAnalyser
    {
        public static List<BaseAlert> AnalyseEarthquakeData(List<EarthquakeData> earthquakeData)
        {
            List<BaseAlert> baseAlerts = new List<BaseAlert>();
            foreach (EarthquakeData ed in earthquakeData)
            {
                if (ed.Magnitude >= 3)
                {
                    baseAlerts.Add(new BaseAlert
                    {
                        NotificationDescription = new NotificationDescription
                        {
                            alert_type = AlertTypes.EarthquakeAlert,
                            notification = Convert.ToString(ed.Magnitude + " " + ed.Depth)
                        }
                    });
                }
            }
            return baseAlerts;
        }
    }
}
